package com.at.clinica.services.impl;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import com.at.clinica.repository.ICategoriaRepository;
import com.at.clinica.services.ISubCategoriaServices;
import com.at.clinica.vos.SubCategoria;

public class SubCategoriaServices implements ISubCategoriaServices {
	
	@Autowired
	ICategoriaRepository repoSubCategoria;
	 
	protected final Log logger = LogFactory.getLog(getClass());

	@Transactional
	@Override
	public void agregarSubCategoria(SubCategoria subCategoria) throws Exception {
		repoSubCategoria.saveUpdate(subCategoria);
		
	}

	@Override
	public List<SubCategoria> listarSubCategorias() throws Exception {
		return repoSubCategoria.getListEntity(SubCategoria.class);
	}
	
}